'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    return await queryInterface.createTable('article_comments', {
      id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
      article_id: Sequelize.INTEGER,
      content: Sequelize.TEXT,
      userId: Sequelize.INTEGER,
      username: Sequelize.STRING(20),
      state: Sequelize.STRING(2),
      create_time: Sequelize.DATE,
    })
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add reverting commands here.
     *
     * Example:
     * await queryInterface.dropTable('users');
     */
    return await queryInterface.dropTable('article_comments');
  }
};
